package com.company.management.controller.reward;

import com.company.management.domain.reward.ScoreLevel;
import com.company.management.service.reward.ScoreLevelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @description:扣分加分机制
 * @author: wangbin
 * @time: 2025/3/1
 **/
@RestController
@RequestMapping("/api/score-level")
public class ScoreLevelController {
    @Autowired
    private ScoreLevelService scoreLevelService;

    /**
     * @param flag 增加或减少
     * @return
     **/
    @GetMapping("/getScoreLevel")
    public ResponseEntity<List<ScoreLevel>> add(@RequestParam("flag") Integer flag) {
        return new ResponseEntity<>(scoreLevelService.findByFlag(flag), HttpStatus.OK);
    }
}
